package guoanmaker.operator.business.repository;



import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import guoanmaker.operator.business.model.OperatorSendMesToCus;


public interface OperatorSendMesToCusRepositoy extends JpaRepository<OperatorSendMesToCus, String>, JpaSpecificationExecutor<OperatorSendMesToCus>{
	   @Query("select u from OperatorSendMesToCus u  where u.sendWay in(13,15) and u.phone=:phone")
	   public Page<OperatorSendMesToCus> findSendMesToCusList(Pageable pageable,@Param("phone") String phone);
	   @Query("select u from OperatorSendMesToCus u  where u.sendWay=13 and u.phone=:phone")
	   public Page<OperatorSendMesToCus> findSendMesToCusListPc(Pageable pageable,@Param("phone") String phone);
	   @Query("select u from OperatorSendMesToCus u  where u.sendWay=13 and u.phone=:phone and u.sendStatus=:sendStatus")
	   public Page<OperatorSendMesToCus> findSendMesToCusListBystatus(Pageable pageable,@Param("phone") String phone,@Param("sendStatus") String sendStatus);
	   @Query("select u from OperatorSendMesToCus u  where u.sendWay=13 and u.phone=:phone")
	   public List<OperatorSendMesToCus> findAllPcList(@Param("phone") String phone);
	   
	   @Query("select u from OperatorSendMesToCus u  where u.sendWay in(13,15) and u.phone=:phone and u.sendStatus=:sendStatus")
	   public List<OperatorSendMesToCus> findPcBystatus(@Param("phone") String phone,@Param("sendStatus") String sendStatus);
}



